﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using IronSuit.DataMap;

namespace IronSuit.CrazyMingWeb
{
	/// <summary>
	/// Summary description for IronList
	/// </summary>
	[WebService(Namespace = "http://tempuri.org/")]
	[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
	[System.ComponentModel.ToolboxItem(false)]
	// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
	// [System.Web.Script.Services.ScriptService]
	public class IronList : System.Web.Services.WebService
	{

		[WebMethod]
		public APIResult QueryIronList()
		{
			APIResult r = new APIResult();
			r.DataList  = new List<APIItem>();
			using (DBFactory dbf = new DBFactory("SalaryConn"))
			{
				Salary p = new Salary();
				long  t = dbf.Count(p);
				r.DataList.Add(new APIItem("ListCount", t));
			}
			return r;
		}
	}
	public class APIItem
	{
		public APIItem()
		{
		}
		public APIItem(string key, object value)
		{
			this.Key = key;
			this.Value = value.ToString();
		}
		public string Key;
		public string Value;
	}
	public class APIResult
	{
		public string ResultCode;
		public string ResultMessage;
		public List<APIItem> DataList;
	}
}
